library(FAIRsimulator) set.seed(3243)
The first step is to create an initial study object.
StudyObjIni <- createStudy( recruitmentAges = list(c(0,1)*30,c(6,7)*30,c(12,13)*30), nSubjects = c(300,300,300), Recruitmentfunction=function(...) {return(5000)}, samplingDesign = list(0:6*30, c(0,3,6)*30, c(0,3,6)*30), studyStopTime = 18*30+3, latestTimeForNewBirthCohorts=0*30, treatments =list( c("SoC-1","TRT-1","TRT-2","TRT-3","TRT-4"), c("SoC-2","TRT-5","TRT-6","TRT-7","TRT-8"), c("SoC-3","TRT-9","TRT-10","TRT-11","TRT-12")), effSizes = list(c(0,0.05,0.1,0.15,0.25), c(0,0.05,0.1,0.15,0.25), c(0,0.05,0.1,0.15,0.25)), randomizationProbabilities = list(rep(0.20,5),rep(0.20,5),rep(0.20,5)), strCovariates = c("BIRTHWT","MAGE", "MHTCM", "SEXN", "SANITATN"), minAllocationProbabilities = list(c(0.2,rep(0,4)),c(0.2,rep(0,4)),c(0.2,rep(0,4))) )
The above design choices can be changed by the user.
The study is simulated with the AdaptiveStudy
function.
StudyObj<-AdaptiveStudy(StudyObjIni)
The plotStudyCohorts
function provides a high level picture of the study.
plotStudyCohorts(StudyObj,plotAnaTimes = T)
plotActiveSubjects(StudyObj)
The simulated HAZ values can be inspected using the plotHAZ
function.
plotHAZ(StudyObj)
The randomization probabilities before any modifications can be visualized with the plotProbs
function while specifying strProb="UnWeightedUpdateProbabilities
.
plotProbs(StudyObj,strProb="UnWeightedUpdateProbabilities")
The probabilities after modifications can also be plotted. The SoC probabilities are reset to 0.2 and TRT-9 and TRT-10 are deemed futile (set to 0). TRT-8 falls below a probability of 0.1. This is because the futility evaluation happens before the probabilities are adjusted to accommodate minimum allocation levels.
plotProbs(StudyObj,strProb="UpdateProbabilities")
This study is the same as the one in the first example except that new cohorts are included in the youngest age group. The randomization probabilities for the new cohorts are based on the analys of the cohort preceeding it.
set.seed(32423) probTemperation <- function(probs) { probs <- sqrt(probs)/sum(sqrt(probs)) return(probs) } StudyObjIni <- createStudy( recruitmentAges = list(c(0,1)*30,c(6,7)*30,c(12,13)*30), nSubjects = c(300,300,300), Recruitmentfunction=function(...) {return(5000)}, samplingDesign = list(0:6*30, c(0,3,6)*30, c(0,3,6)*30), studyStopTime = 32*30, latestTimeForNewBirthCohorts=18*30, treatments =list( c("SoC-1","TRT-1","TRT-2","TRT-3","TRT-4"), c("SoC-2","TRT-5","TRT-6","TRT-7","TRT-8"), c("SoC-3","TRT-9","TRT-10","TRT-11","TRT-12")), effSizes = list(c(0,0.05,0.1,0.15,0.25), c(0,0.05,0.1,0.15,0.25), c(0,0.05,0.1,0.15,0.25)), randomizationProbabilities = list(rep(0.20,5),rep(0.20,5),rep(0.20,5)), strCovariates = c("BIRTHWT","MAGE", "MHTCM", "SEXN", "SANITATN"), minAllocationProbabilities = list(c(0.2,rep(0,4)),c(0.2,rep(0,4)),c(0.2,rep(0,4))) )
StudyObj <- AdaptiveStudy(StudyObjIni)
plotStudyCohorts(StudyObj)
The unadjusted probabilities:
plotProbs(StudyObj,strProb="UnWeightedUpdateProbabilities")
The adjusted probabilities:
plotProbs(StudyObj) #plotProbs(StudyObj,strProb="UnWeightedRandomizationProbabilities")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.